"""
用户 视图模型
"""

from datetime import datetime

from pydantic import (
    BaseModel,
    Field,
)

import utils.enum_utils as enum


class UserViewModel(BaseModel):
    """ 用户 视图模型 """

    username: str = Field(..., title="用户名", min_length=3, max_length=20)

    nickname: str = Field(..., title="昵称", min_length=3, max_length=20)

    gender: enum.Gender = Field(..., title="性别")

    last_active: datetime = Field(..., title="最近活跃时间")

    code: str = Field(..., title="编号", min_length=20, max_length=20)
